#ifndef _DRV_STRUCT_D2_H
#define _DRV_STRUCT_D2_H

#ifdef __cplusplus
extern "C" {
#endif

#if (HOST_IS_LE == 1)

struct ms_packet_header_d2_s
{
    /*word9[31:0]*/
    uint32 prio                                                             : 4;
    uint32 terminate_cid_hdr                                                : 1;
    uint32 dest_map                                                         : 19;
    uint32 packet_offset                                                    : 8;

    /*word8[31:0]*/
    uint32 src_svlan_id_11_11                                               : 1;
    uint32 source_port                                                      : 16;
    uint32 logic_port_type                                                  : 1;
    uint32 header_hash                                                      : 8;
    uint32 src_stag_cos                                                     : 3;
    uint32 packet_type                                                     : 3;

    /*word7[31:0]*/
    uint32 from_lag                                                         : 1;
    uint32 next_hop_ptr                                                     : 18;
    uint32 color                                                            : 2;
    uint32 src_svlan_id_10_0                                                : 11;

    /*word6[31:0]*/
    uint32 mux_length_type                                                  : 2;
    uint32 src_vlan_ptr                                                     : 13;
    uint32 svlan_tpid_index                                                 : 2;
    uint32 from_cpu_or_oam                                                  : 1;
    uint32 outer_vlan_is_c_vlan                                        : 1;
    uint32 ingress_edit_en                                                  : 1;
    uint32 from_cpu_lm_down_disable                                         : 1;
    uint32 ds_next_hop_bypass_all                                           : 1;
    uint32 bypass_ingress_edit                                              : 1;
    uint32 from_fabric                                                      : 1;
    uint32 source_port_extender                                             : 1;
    uint32 svlan_tag_operation_valid                                        : 1;
    uint32 from_cpu_lm_up_disable                                           : 1;
    uint32 port_mac_sa_en                                                   : 1;
    uint32 next_hop_ext                                                     : 1;
    uint32 src_stag_cfi                                                     : 1;
    uint32 is_leaf                                                          : 1;
    uint32 critical_packet                                                  : 1;

    /*word5[31:0]*/
    uint32 logic_src_port_13_5                                              : 9;
    uint32 fid                                                              : 14;
    uint32 oam_use_fid                                                      : 1;
    uint32 mac_known                                                        : 1;
    uint32 stag_action                                                      : 2;
    uint32 iloop_from_cpu                                                   : 1;
    uint32 is_debugged_pkt                                                  : 1;
    uint32 mac_learning_en                                                  : 1;
    uint32 bridge_operation                                                 : 1;
    uint32 oam_tunnel_en                                                    : 1;

    /*word4[31:0]*/
    uint32 u3_data_2                                                        : 16;  /*u3_other_i2eSrcCidValid{4,7,1}
                                                                                      u3_other_from_cpu{4,8,1}
                                                                                      u3_other_destChannelIdFromCpu{4,8,6
                                                                                      u3_other_destChannelIdValidFromCpu{4,14,1}*/
    uint32 operation_type                                                   : 3;
    uint32 ttl                                                              : 8;
    uint32 logic_src_port_4_0                                               : 5;

    /*word3[31:0]*/
    uint32 timestamp_36_5_31_16                                             : 16;
    uint32 local_phy_port                                                  : 8;
    uint32 u3_data_1                                                        : 8;

    /*word2[31:0]*/
    uint32 u1_data                                                          : 10;  /*u1_oam_rxOam, u1_oam_rxOam{2,0,1}*/
    uint32 u2_data : 6;
    uint32 timestamp_36_5_15_0                                              : 16;

    /*word0[31:0] word1[31:0]*/
    union
    {
        struct
        {
            uint32 rsv1                                                         : 32;

            uint32 stacking_src_port                                        : 16;
            uint32 c2c_check_disable                                        : 1;
            uint32 sgmac_strip_header                                       : 1;
            uint32 neighbor_discover_packet                                 : 1;
            uint32 rsv0                                                         : 13;

        }c2c;

        struct
        {
            uint32 rsv1                                                         : 32;

            uint32 dm_offset                                                : 8;
            uint32 rsv0                                                         : 24;
        }dmtx;

        struct
        {
            uint32 decrypt_key_index_7_2                                    : 6;
            uint32 reassemble_offset                                        : 8;
            uint32 need_capwap_reassemble                                   : 1;
            uint32 capwap_last_frag                                         : 1;
            uint32 rsv1                                                         : 16;

            uint32 user_default_cfi                                         : 1;
            uint32 user_default_cos                                         : 3;
            uint32 user_default_vlan_id                                     : 12;
            uint32 use_default_vlan_tag                                     : 1;
            uint32 user_default_vlan_valid                                  : 1;
            uint32 service_acl_qos_en                                       : 1;
            uint32 capwap_tunnel_type                                       : 2;
            uint32 capwap_mcast                                             : 1;
            uint32 need_dot1ae_decrypt                                      : 1;
            uint32 need_capwap_decap                                        : 1;
            uint32 need_capwap_decrypt                                      : 1;
            uint32 mirrored_packet_with_sec_tag                             : 1;
            uint32 mirrored_packet_with_sci                                 : 1;
            uint32 src_dscp_valid                                           : 1;
            uint32 acl_dscp_valid                                           : 1;
            uint32 capwap_encaped                                           : 1;
            uint32 decrypt_key_index_1_0                                    : 2;
        }e2iloop_in;

        struct
        {
            uint32 rsv1                                                         : 32;

            uint32 user_default_cfi                                         : 1;
            uint32 user_default_cos                                         : 3;
            uint32 user_default_vlan_id                                     : 12;
            uint32 use_default_vlan_tag                                     : 1;
            uint32 user_default_vlan_valid                                  : 1;
            uint32 service_acl_qos_en                                       : 1;
            uint32 capwap_tunnel_type                                       : 2;
            uint32 capwap_mcast                                             : 1;
            uint32 need_dot1ae_decrypt                                      : 1;
            uint32 need_capwap_decap                                        : 1;
            uint32 need_capwap_decrypt                                      : 1;
            uint32 mirrored_packet_with_sec_tag                             : 1;
            uint32 mirrored_packet_with_sci                                 : 1;
            uint32 src_dscp_valid                                           : 1;
            uint32 acl_dscp_valid                                           : 1;
            uint32 capwap_encaped                                           : 1;
            uint32 need_dot1ae_encrypt                                      : 1;
            uint32 rsv                                                      : 1;
        }e2iloop_out;

        struct
        {
            uint32 rx_fcb_31_24                                             : 8;
            uint32 tx_fcb_23_0                                              : 24;

            uint32 rxtx_fcl                                                 : 8;
            uint32 rx_fcb_23_0                                              : 24;
        }lmtx;

        struct
        {
            uint32 ipsa_39_19                                               : 21;
            uint32 l4_source_port_valid                                     : 1;
            uint32 l4_source_port_9_0                                       : 10;

            uint32 no_dot1ae_encrypt                                        : 1;
            uint32 micro_burst_valid                                        : 1;
            uint32 acl_dscp_valid                                           : 1;
            uint32 src_dscp_valid                                           : 1;
            uint32 ipsa_prefix_length                                       : 3;
            uint32 ipsa_mode                                                : 2;
            uint32 pt_enable                                                : 1;
            uint32 ipv4_src_embeded_mode                                    : 1;
            uint32 src_address_mode                                         : 1;
            uint32 ipsa_valid                                               : 1;
            uint32 ipsa_18_0                                                : 19;
        }nat;

        struct
        {
             uint32 source_port_isolateId                                : 7;
            uint32 src_ctag_offset_type                                     : 1;
            uint32 src_ctag_cfi                                             : 1;
            uint32 src_ctag_cos                                             : 3;
            uint32 ctag_action                                              : 2;
            uint32 pbb_check_discard                                        :1;
            uint32 cn_action                                                : 2;
            uint32 src_dscp_valid                                           : 1;
            uint32 acl_dscp_valid                                           : 1;
            uint32 ecmp_hash                                                : 8;
            uint32 dot1ae_encrypted                                         : 1;
            uint32 acl_ctag_cfi_valid                                       : 1;
            uint32 acl_stag_cfi_valid                                       : 1;
            uint32 acl_ctag_cos_valid                                       : 1;
            uint32 acl_stag_cos_valid                                       : 1;

            uint32 no_dot1ae_encrypt                                        : 1;
            uint32 metadata                                                 : 14;
            uint32 metadata_type                                            : 2;
            uint32 microburst_valid                                         : 1;
            uint32 cvlan_tag_operation_valid                                : 1;
            uint32 isid_valid                                                 : 1;
            uint32 src_cvlan_id                                             : 12;
        }normal;

        struct
        {
            uint32 rx_fcb_31_24                                             : 8;
            uint32 lm_received_packet                                       : 1;
            uint32 dm_en                                                    : 1;
            uint32 is_up                                                    : 1;
            uint32 use_oam_ttl                                              : 1;
            uint32 gal_exist                                                : 1;
            uint32 iloop_to_agg_up_mep                                      : 1;
            uint32 link_oam                                                 : 1;
            uint32 oam_type                                                 : 4;
            uint32 mep_index                                                : 13;

            uint32 rxtx_fcl                                                 : 8;
            uint32 rx_fcb_23_0                                              : 24;
        }oam;

        struct
        {
            uint32 timestamp61_37_24_10                                     : 15;
            uint32 rsv1                                                         : 17;

            uint32 is_cflex_update_residence_time                           : 1;
            uint32 src_dscp_valid                                           : 1;
            uint32 acl_dscp_valid                                           : 1;
            uint32 ptp_offset                                               : 8;
            uint32 ptp_update_residence_time                                : 1;
            uint32 ptp_apply_egress_asymmetry_delay                         : 1;
            uint32 ptp_replace_timestamp                                    : 1;
            uint32 is_l4_ptp                                                : 1;
            uint32 is_l2_ptp                                                : 1;
            uint32 ptp_deep_parser                                          : 1;
            uint32 timestamp_4_0                                            : 5;
            uint32 timestamp61_37_9_0                                       : 10;
        }ptp;
    }u1;
};

struct ds_eth_mep_d2_s {
   uint32 mep_type                                                         :3;
   uint32 eth_oam_p2_p_mode                                                :1;
   uint32 active                                                           :1;
   uint32 is_bfd                                                           :1;
   uint32 is_remote                                                        :1;
   uint32 is_up                                                            :1;
   uint32 ma_index                                                         :13;
   uint32 ccm_interval                                                     :3;
   uint32 mep_id_7_0                                                      :8;

   uint32 mep_id_12_8                                                     :5;
   uint32 mep_primary_vid                                                  :12;
   uint32 ma_id_check_disable                                              :1;
   uint32 aps_bridge_en                                                    :1;
   uint32 enable_pm                                                        :1;
   uint32 cci_en                                                           :1;
   uint32 seq_num_en                                                       :1;
   uint32 share_mac_en                                                     :1;
   uint32 ccm_seq_num_8_0                                                 :9;

   uint32 ccm_seq_num_29_9                                                :21;
   uint32 rsv_0                                                            :11;

   uint32 ccm_seq_num_31_30                                               :2;
   uint32 auto_gen_pkt_ptr                                                 :4;
   uint32 p2p_use_uc_da                                                    :1;
   uint32 d_meg_lvl_timer                                                  :4;
   uint32 d_mismerge_timer                                                 :4;
   uint32 d_unexp_mep_timer                                                :4;
   uint32 port_id                                                          :8;
   uint32 d_meg_lvl                                                        :1;
   uint32 d_mismerge                                                       :1;
   uint32 d_unexp_mep                                                      :1;
   uint32 tpid_type                                                        :2;

   uint32 present_rdi                                                      :1;
   uint32 rmep_last_rdi                                                    :1;
   uint32 port_status                                                      :2;
   uint32 auto_gen_en                                                      :1;
   uint32 cci_while                                                        :3;
   uint32 dest_map                                                         :19;
   uint32 aps_signal_fail_local                                            :3;
   uint32 learn_en                                                         :1;
   uint32 unknown_ccm_num_0                                               :1;

   uint32 unknown_ccm_num_2_1                                             :2;
   uint32 ccm_stat_en                                                      :1;
   uint32 u1_g1_cvlan_tag                                                  :16;
   uint32 protection_path                                                  :1;
   uint32 rsv_1                                                            :12;
};
struct ds_eth_rmep_d2_s {
   uint32 mep_type                                                         :3;
   uint32 eth_oam_p2_p_mode                                                :1;
   uint32 active                                                           :1;
   uint32 is_bfd                                                           :1;
   uint32 is_remote                                                        :1;
   uint32 is_up                                                            :1;
   uint32 protection_path                                                  :1;
   uint32 u3_g1_mep_index                                                  :14;
   uint32 rmepmacmismatch                                                  :1;
   uint32 seq_num_en                                                       :1;
   uint32 rmep_mac_sa_6_0                                                 :7;

   uint32 rmep_mac_sa_38_7                                                :32;

   uint32 rmep_mac_sa_47_39                                               :9;
   uint32 mac_status_change                                                :1;
   uint32 is_csf_en                                                        :1;
   uint32 u1_g1_ccm_seq_num_9_0                                           :10;
   uint32 rsv_0                                                            :11;

   uint32 u1_g1_ccm_seq_num_31_10                                         :22;
   uint32 aps_signal_fail_remote                                           :5;
   uint32 cnt_shift_while                                                  :3;
   uint32 exp_ccm_num_1_0                                                 :2;

   uint32 exp_ccm_num_7_2                                                 :6;
   uint32 d_loc                                                            :1;
   uint32 d_unexp_period_timer                                             :4;
   uint32 d_unexp_period                                                   :1;
   uint32 rmep_last_rdi                                                    :1;
   uint32 rmep_while                                                       :4;
   uint32 mac_addr_update_disable                                          :1;
   uint32 seq_num_fail_counter                                             :6;
   uint32 rmep_last_port_status                                            :2;
   uint32 first_pkt_rx                                                     :1;
   uint32 rmep_last_intf_status                                            :3;
   uint32 aps_group_id_1_0                                                :2;

   uint32 aps_group_id_11_2                                               :10;
   uint32 rsv_1                                                            :10;
   uint32 fast_aps_en                                                      :1;
   uint32 rsv_2                                                            :11;
};
struct ds_bfd_mep_d2_s {
   uint32 mep_type                                                         :3;
   uint32 eth_oam_p2_p_mode                                                :1;
   uint32 active                                                           :1;
   uint32 is_bfd                                                           :1;
   uint32 is_remote                                                        :1;
   uint32 is_up                                                            :1;
   uint32 ma_index                                                         :13;
   uint32 ccm_interval                                                     :3;
   uint32 u2_g1_bfd_srcport_7_0                                           :8;

   uint32 u2_g1_bfd_srcport_15_8                                          :8;
   uint32 cci_en                                                           :1;
   uint32 hello_while                                                      :10;
   uint32 local_diag                                                       :5;
   uint32 micro_b_f_d                                                      :1;
   uint32 rx_csf_while_6_0                                                :7;

   uint32 rx_csf_while_12_7                                               :6;
   uint32 actual_min_tx_interval                                           :10;
   uint32 desired_min_tx_interval_4_0                                     :5;
   uint32 rsv_0                                                            :11;

   uint32 desired_min_tx_interval_9_5                                     :5;
   uint32 local_disc_26_0                                                 :27;

   uint32 local_disc_31_27                                                :5;
   uint32 local_stat                                                       :2;
   uint32 ip_da_l                                                          :20;
   uint32 dest_map_4_0                                                    :5;

   uint32 dest_map_18_5                                                   :14;
   uint32 cc_tx_mode                                                       :1;
   uint32 aps_group_id                                                     :6;
   uint32 rsv_1                                                            :11;
};
struct ds_bfd_rmep_d2_s
{
   uint32 mep_type                                                         :3;
   uint32 eth_oam_p2_p_mode                                                :1;
   uint32 active                                                           :1;
   uint32 is_bfd                                                           :1;
   uint32 is_remote                                                        :1;
   uint32 is_up                                                            :1;
   uint32 protection_path                                                  :1;
   uint32 u1_g1_ip_sa_22_0                                                :23;

   uint32 u1_g1_ip_sa_31_23                                               :9;
   uint32 required_min_rx_interval                                         :10;
   uint32 is_csf_tx_en                                                     :1;
   uint32 aps_signal_fail_remote                                           :2;
   uint32 aps_bridge_en                                                    :1;
   uint32 actual_rx_interval_8_0                                          :9;

   uint32 actual_rx_interval_9                                            :1;
   uint32 remote_diag                                                      :5;
   uint32 disc_chk_en                                                      :1;
   uint32 fbit                                                             :1;
   uint32 fast_aps_en                                                      :1;
   uint32 local_defect_mult                                                :4;
   uint32 defect_while_7_0                                                :8;
   uint32 rsv_0                                                            :11;

   uint32 defect_while_13_8                                               :6;
   uint32 is_cv_en                                                         :1;
   uint32 is_csf_en                                                        :1;
   uint32 defect_mult                                                      :4;
   uint32 first_pkt_rx                                                     :1;
   uint32 remote_disc_18_0                                                :19;

   uint32 remote_disc_31_19                                               :13;
   uint32 remote_stat                                                      :2;
   uint32 ach_chan_type                                                    :3;
   uint32 is_multi_hop                                                     :1;
   uint32 slow_tx_timer_cfg                                                :2;
   uint32 ip_da_h_10_0                                                    :11;

   uint32 ip_da_h_11                                                      :1;
   uint32 echo_rx_en                                                       :1;
   uint32 d_loc                                                            :1;
   uint32 learn_en                                                         :1;
   uint32 time_negotiation                                                 :1;
   uint32 ip_bfd_ttl                                                       :8;
   uint32 pbit                                                             :1;
   uint32 cc_tx_mode                                                       :1;
   uint32 aps_group_id                                                     :6;
   uint32 rsv_1                                                            :11;
};
typedef struct
{
    uint32 packetCount_27_0:28;
    uint32 byteCount_3_0:4;
    uint32 byteCount_35_4;
}DsStats_d2_s;

struct ms_dlb_efd_mon_d2_s
{
    /*word0[31:0]*/
    uint32  efdMonPtr        : 10;
    uint32  efdMonValid      : 1;
    uint32  dlbMonPtr        : 11;
    uint32  dlbMonValid      : 1;
    uint32  rsv0             : 9;

    /*word1-5[31:0]*/
    uint32  rsv1             : 32;
    uint32  rsv2             : 32;
    uint32  rsv3             : 32;
    uint32  rsv4             : 32;
    uint32  rsv5             : 32;

    /*word6[31:0]*/
    uint32  rsv6             : 8;
    uint32  monType          : 2;
    uint32  timestamp_21_0   : 22;

    /*word7[31:0]*/
    uint32  timestamp_53_22  : 32;
};

struct ms_latency_mon_d2_s
{
    union
    {
        struct
        {
            uint32 infoType             :1;
            uint32 channelId            :7;
            uint32 localPhyPort         :8;
            uint32 region               :4;
            uint32 residenceTime_11_0   :12;

            uint32 residenceTime_43_12  :32;

            uint32 residenceTime_47_44  :4;
            uint32 sourcePort           :16;
            uint32 timestamp_11_0       :12;

            uint32 timestamp_43_12      :32;

            uint32 timestamp_63_44      :20;
            uint32 valid                :1;
            uint32 rsv0                 :11;

        }event;

        struct
        {
            uint32 infoType             :1;
            uint32 channelId            :7;
            uint32 latencyThrdCnt0_23_0 :24;

            uint32 latencyThrdCnt1_23_0 :24;
            uint32 latencyThrdCnt2_7_0  :8;

            uint32 latencyThrdCnt2_23_8 :16;
            uint32 latencyThrdCnt3_15_0 :16;

            uint32 latencyThrdCnt3_23_16:8;
            uint32 latencyThrdCnt4_23_0 :24;

            uint32 latencyThrdCnt5_23_0 :24;
            uint32 latencyThrdCnt6_7_0  :8;

            
            uint32 latencyThrdCnt6_23_8 :16;
            uint32 latencyThrdCnt7_15_0 :16;

            uint32 latencyThrdCnt7_23_16:8;
            uint32 rsv1                 :24;
        }mon; 
    }u;
};

struct temp_irm_resrc_mon_info_d2_s
{
    /*word0~3*/
    union
    {
        struct
        {
            uint32 monInfoType            : 2;
            uint32 pktBufCnt              : 14;
            uint32 channelId              : 6;
            uint32 rsv1                   : 10;

            uint32 rsv2                   : 32;
        }g1;
        struct
        {
            uint32 monInfoType            : 2;
            uint32 scCnt_0                : 14;
            uint32 scCnt_1                : 14;
            uint32 scCnt_2_1_0            : 2;

            uint32 scCnt_2_13_2           : 12;
            uint32 scCnt_3                : 14;
            uint32 rsv1                   : 6;
        }g2;

        struct
        {
            uint32 monInfoType            : 2;
            uint32 totalCnt               : 14;
            uint32 criticalCnt            : 14;
            uint32 c2cCnt_1_0             : 2;

            uint32 c2cCnt_13_2            : 12;
            uint32 rsv1                   : 20;
        }g3;

        struct
        {
            uint32 monInfoType            : 2;
            uint32 portTcCnt              : 14;
            uint32 portTcCntValid         : 1;
            uint32 mappedTc               : 3;
            uint32 rsv1                   : 12;

            uint32 rsv2                   : 32;
        }g4;
    }u;
};

struct ms_irm_mon_d2_s
{
    uint32 infoType                       : 1;
    uint32 u_30_0                         : 31;

    uint32 u_62_31                        : 32;
};

struct temp_erm_resrc_mon_info_d2_s
{
    /*word0~3*/
    union
    {
        struct
        {
            uint32 monInfoType            : 2;
            uint32 pktBufCnt              : 14;
            uint32 ucastBufCnt            : 14;
            uint32 mcastBufCnt_1_0        : 2;

            uint32 mcastBufCnt_13_2       : 12;
            uint32 channelId              : 6;
            uint32 rsv1                   : 14;
        }g1;
        struct
        {
            uint32 monInfoType            : 2;
            uint32 scCnt_0                : 14;
            uint32 scCnt_1                : 14;
            uint32 scCnt_2_1_0            : 2;

            uint32 scCnt_2_13_2           : 12;
            uint32 scCnt_3                : 14;
            uint32 rsv1                   : 6;
        }g2;

        struct
        {
            uint32 monInfoType            : 2;
            uint32 totalCnt               : 14;
            uint32 spanCnt                : 14;
            uint32 criticalCnt_1_0        : 2;

            uint32 criticalCnt_13_2       : 12;
            uint32 rsv1                   : 20;
        }g3;

        struct
        {
            uint32 monInfoType            : 2;
            uint32 queueCnt               : 14;
            uint32 queueCntValid          : 1;
            uint32 queueOffset            : 3;
            uint32 detailedType           : 2;
            uint32 rsv1                   : 10;

            uint32 rsv2                   : 32;
        }g4;
    }u;
};

struct temp_erm_mb_mon_info_d2_s
{
    uint32 ucastBufCnt                    : 14;
    uint32 mcastBufCnt                    : 14;
    uint32 sc                             : 2;
    uint32 cngLevel                       : 2;

    uint32 channelId                      : 6;
    uint32 microburstValid                : 1;
    uint32 rsv                            : 25;
};

struct ms_erm_mon_d2_s
{
    uint32 infoType               :1;
    uint32 u_30_0                 :31;

    uint32 u_62_31                :32;

    uint32 u_94_63                :32;
};

struct sys_learning_aging_decode_d2_s
{
    uint32 is_learning_dma          : 1;
    uint32 hash_result_index        : 19;
    uint32 is_learning              : 1;
    uint32 uShare_0_10              : 11;

    uint32 uShare_11_42             : 32;

    uint32 uShare_43_51             : 9;
    uint32 macsa_0_22               : 23;

    uint32 macsa_23_47              : 25;
    uint32 vsi_id_0_6               : 7;

    uint32 vsi_id_7_13              : 7;
    uint32 is_global_src_port       : 1;
    uint32 learning_source_port     : 16;
    uint32 fast_learning_en         : 1;
    uint32 rsv_0                    : 7;
};

#else

struct ms_packet_header_d2_s
{
    /*word9[31:0]*/
    uint32 packet_offset                                                    : 8;
    uint32 dest_map                                                         : 19;
    uint32 terminate_cid_hdr                                                : 1;
    uint32 prio                                                             : 4;

    /*word8[31:0]*/
    uint32 packet_type                                                     : 3;
    uint32 src_stag_cos                                                     : 3;
    uint32 header_hash                                                      : 8;
    uint32 logic_port_type                                                  : 1;
    uint32 source_port                                                      : 16;
    uint32 src_svlan_id_11_11                                               : 1;

    /*word7[31:0]*/
    uint32 src_svlan_id_10_0                                                : 11;
    uint32 color                                                            : 2;
    uint32 next_hop_ptr                                                     : 18;
    uint32 from_lag                                                         : 1;

    /*word6[31:0]*/
    uint32 critical_packet                                                  : 1;
    uint32 is_leaf                                                          : 1;
    uint32 src_stag_cfi                                                     : 1;
    uint32 next_hop_ext                                                     : 1;
    uint32 port_mac_sa_en                                                   : 1;
    uint32 from_cpu_lm_up_disable                                           : 1;
    uint32 svlan_tag_operation_valid                                        : 1;
    uint32 source_port_extender                                             : 1;
    uint32 from_fabric                                                      : 1;
    uint32 bypass_ingress_edit                                              : 1;
    uint32 ds_next_hop_bypass_all                                           : 1;
    uint32 from_cpu_lm_down_disable                                         : 1;
    uint32 ingress_edit_en                                                  : 1;
    uint32 outer_vlan_is_c_vlan                                        : 1;
    uint32 from_cpu_or_oam                                                  : 1;
    uint32 svlan_tpid_index                                                 : 2;
    uint32 src_vlan_ptr                                                     : 13;
    uint32 mux_length_type                                                  : 2;

    /*word5[31:0]*/
    uint32 oam_tunnel_en                                                    : 1;
    uint32 bridge_operation                                                 : 1;
    uint32 mac_learning_en                                                  : 1;
    uint32 is_debugged_pkt                                                  : 1;
    uint32 iloop_from_cpu                                                   : 1;
    uint32 stag_action                                                      : 2;
    uint32 mac_known                                                        : 1;
    uint32 oam_use_fid                                                      : 1;
    uint32 fid                                                              : 14;
    uint32 logic_src_port_13_5                                              : 9;

    /*word4[31:0]*/
    uint32 logic_src_port_4_0                                               : 5;
    uint32 ttl                                                              : 8;
    uint32 operation_type                                                   : 3;
    uint32 u3_data_2                                                        : 16;  /*u3_other_i2eSrcCidValid{4,7,1}
                                                                                      u3_other_from_cpu{4,7,1}
                                                                                      u3_other_destChannelIdFromCpu{4,9,6
                                                                                      u3_other_destChannelIdValidFromCpu{4,14,1}*/
    /*word3[31:0]*/
    uint32 u3_data_1                                                        : 8;
    uint32 local_phy_port                                                  : 8;
    uint32 timestamp_36_5_31_16                                            : 16;

    /*word2[31:0]*/
    uint32 timestamp_36_5_15_0                                              : 16;
    uint32 u2_data                                                          : 6;
    uint32 u1_data                                                          : 10;  /*u1_oam_rxOam, u1_oam_rxOam{2,0,1}*/

    /*word0[31:0] word1[31:0]*/
    union
    {
        struct
        {
            uint32 rsv1                                                         : 32;

            uint32 rsv0                                                         : 13;
            uint32 neighbor_discover_packet                                 : 1;
            uint32 sgmac_strip_header                                       : 1;
            uint32 c2c_check_disable                                        : 1;
            uint32 stacking_src_port                                        : 16;
        }c2c;

        struct
        {
            uint32 rsv1                                                         : 32;

            uint32 rsv0                                                         : 24;
            uint32 dm_offset                                                : 8;
        }dmtx;

        struct
        {
            uint32 rsv1                                                         : 16;
            uint32 capwap_last_frag                                         : 1;
            uint32 need_capwap_reassemble                                   : 1;
            uint32 reassemble_offset                                        : 8;
            uint32 decrypt_key_index_7_2                                    : 6;

            uint32 decrypt_key_index_1_0                                    : 2;
            uint32 capwap_encaped                                           : 1;
            uint32 acl_dscp_valid                                           : 1;
            uint32 src_dscp_valid                                           : 1;
            uint32 mirrored_packet_with_sci                                 : 1;
            uint32 mirrored_packet_with_sec_tag                             : 1;
            uint32 need_capwap_decrypt                                      : 1;
            uint32 need_capwap_decap                                        : 1;
            uint32 need_dot1ae_decrypt                                      : 1;
            uint32 capwap_mcast                                             : 1;
            uint32 capwap_tunnel_type                                       : 2;
            uint32 service_acl_qos_en                                       : 1;
            uint32 user_default_vlan_valid                                  : 1;
            uint32 use_default_vlan_tag                                     : 1;
            uint32 user_default_vlan_id                                     : 12;
            uint32 user_default_cos                                         : 3;
            uint32 user_default_cfi                                         : 1;
        }e2iloop_in;

        struct
        {
            uint32 rsv1                                                         : 32;

            uint32 need_dot1ae_encrypt                                      : 1;
            uint32 capwap_encaped                                           : 1;
            uint32 acl_dscp_valid                                           : 1;
            uint32 src_dscp_valid                                           : 1;
            uint32 mirrored_packet_with_sci                                 : 1;
            uint32 mirrored_packet_with_sec_tag                             : 1;
            uint32 need_capwap_decrypt                                      : 1;
            uint32 need_capwap_decap                                        : 1;
            uint32 need_dot1ae_decrypt                                      : 1;
            uint32 capwap_mcast                                             : 1;
            uint32 capwap_tunnel_type                                       : 2;
            uint32 service_acl_qos_en                                       : 1;
            uint32 user_default_vlan_valid                                  : 1;
            uint32 use_default_vlan_tag                                     : 1;
            uint32 user_default_vlan_id                                     : 12;
            uint32 user_default_cos                                         : 3;
            uint32 user_default_cfi                                         : 1;
            uint32 rsv                                                      : 1;
        }e2iloop_out;

        struct
        {
            uint32 tx_fcb_23_0                                              : 24;
            uint32 rx_fcb_31_24                                             : 8;

            uint32 rx_fcb_23_0                                              : 24;
            uint32 rxtx_fcl                                                 : 8;
        }lmtx;

        struct
        {
            uint32 l4_source_port_9_0                                       : 10;
            uint32 l4_source_port_valid                                     : 1;
            uint32 ipsa_39_19                                               : 21;

            uint32 ipsa_18_0                                                : 19;
            uint32 ipsa_valid                                               : 1;
            uint32 src_address_mode                                         : 1;
            uint32 ipv4_src_embeded_mode                                    : 1;
            uint32 pt_enable                                                : 1;
            uint32 ipsa_mode                                                : 2;
            uint32 ipsa_prefix_length                                       : 3;
            uint32 src_dscp_valid                                           : 1;
            uint32 acl_dscp_valid                                           : 1;
            uint32 micro_burst_valid                                        : 1;
            uint32 no_dot1ae_encrypt                                        : 1;
        }nat;

        struct
        {
            uint32 acl_stag_cos_valid                                       : 1;
            uint32 acl_ctag_cos_valid                                       : 1;
            uint32 acl_stag_cfi_valid                                       : 1;
            uint32 acl_ctag_cfi_valid                                       : 1;
            uint32 dot1ae_encrypted                                         : 1;
            uint32 ecmp_hash                                                : 8;
            uint32 acl_dscp_valid                                           : 1;
            uint32 src_dscp_valid                                           : 1;
            uint32 cn_action                                                : 2;
            uint32 pbb_check_discard                                        :1;
            uint32 ctag_action                                              : 2;
            uint32 src_ctag_cos                                             : 3;
            uint32 src_ctag_cfi                                             : 1;
            uint32 src_ctag_offset_type                                     : 1;
            uint32 source_port_isolateId                                : 7;

            uint32 src_cvlan_id                                             : 12;
            uint32 isid_valid                                                 : 1;
            uint32 cvlan_tag_operation_valid                                : 1;
            uint32 microburst_valid                                         : 1;
            uint32 metadata_type                                            : 2;
            uint32 metadata                                                 : 14;
            uint32 no_dot1ae_encrypt                                        : 1;
        }normal;

        struct
        {
            uint32 mep_index                                                : 13;
            uint32 oam_type                                                 : 4;
            uint32 link_oam                                                 : 1;
            uint32 iloop_to_agg_up_mep                                      : 1;
            uint32 gal_exist                                                : 1;
            uint32 use_oam_ttl                                              : 1;
            uint32 is_up                                                    : 1;
            uint32 dm_en                                                    : 1;
            uint32 lm_received_packet                                       : 1;
            uint32 rx_fcb_31_24                                             : 8;

            uint32 rx_fcb_23_0                                              : 24;
            uint32 rxtx_fcl                                                 : 8;
        }oam;

        struct
        {
            uint32 rsv1                                                         : 17;
            uint32 timestamp61_37_24_10                                     : 15;

            uint32 timestamp61_37_9_0                                       : 10;
            uint32 timestamp_4_0                                            : 5;
            uint32 ptp_deep_parser                                          : 1;
            uint32 is_l2_ptp                                                : 1;
            uint32 is_l4_ptp                                                : 1;
            uint32 ptp_replace_timestamp                                    : 1;
            uint32 ptp_apply_egress_asymmetry_delay                         : 1;
            uint32 ptp_update_residence_time                                : 1;
            uint32 ptp_offset                                               : 8;
            uint32 acl_dscp_valid                                           : 1;
            uint32 src_dscp_valid                                           : 1;
            uint32 is_cflex_update_residence_time                           : 1;
        }ptp;
    }u1;

};

struct ds_eth_mep_d2_s
{
    uint32 mep_id_7_0                                                      : 8;
    uint32 ccm_interval                                                     : 3;
    uint32 ma_index                                                         : 13;
    uint32 is_up                                                            : 1;
    uint32 is_remote                                                        : 1;
    uint32 is_bfd                                                           : 1;
    uint32 active                                                           : 1;
    uint32 eth_oam_p2_p_mode                                                : 1;
    uint32 mep_type                                                         : 3;

    uint32 ccm_seq_num_8_0                                                 : 9;
    uint32 share_mac_en                                                     : 1;
    uint32 seq_num_en                                                       : 1;
    uint32 cci_en                                                           : 1;
    uint32 enable_pm                                                        : 1;
    uint32 aps_bridge_en                                                    : 1;
    uint32 ma_id_check_disable                                              : 1;
    uint32 mep_primary_vid                                                  : 12;
    uint32 mep_id_12_8                                                     : 5;

    uint32 rsv_0                                                            : 11;
    uint32 ccm_seq_num_29_9                                                : 21;

    uint32 tpid_type                                                        : 2;
    uint32 d_unexp_mep                                                      : 1;
    uint32 d_mismerge                                                       : 1;
    uint32 d_meg_lvl                                                        : 1;
    uint32 port_id                                                          : 8;
    uint32 d_unexp_mep_timer                                                : 4;
    uint32 d_mismerge_timer                                                 : 4;
    uint32 d_meg_lvl_timer                                                  : 4;
    uint32 p2p_use_uc_da                                                    : 1;
    uint32 auto_gen_pkt_ptr                                                 : 4;
    uint32 ccm_seq_num_31_30                                               : 2;

    uint32 unknown_ccm_num_0                                               : 1;
    uint32 learn_en                                                         : 1;
    uint32 aps_signal_fail_local                                            : 3;
    uint32 dest_map                                                         : 19;
    uint32 cci_while                                                        : 3;
    uint32 auto_gen_en                                                      : 1;
    uint32 port_status                                                      : 2;
    uint32 rmep_last_rdi                                                    : 1;
    uint32 present_rdi                                                      : 1;

    uint32 rsv_1                                                            : 12;
    uint32 protection_path                                                  : 1;
    uint32 u1_g1_cvlan_tag                                                  : 16;
    uint32 ccm_stat_en                                                      : 1;
    uint32 unknown_ccm_num_2_1                                             : 2;
};

struct ds_eth_rmep_d2_s
{
    uint32 rmep_mac_sa_6_0                                                 : 7;
    uint32 seq_num_en                                                       : 1;
    uint32 rmepmacmismatch                                                  : 1;
    uint32 u3_g1_mep_index                                                  : 14;
    uint32 protection_path                                                  : 1;
    uint32 is_up                                                            : 1;
    uint32 is_remote                                                        : 1;
    uint32 is_bfd                                                           : 1;
    uint32 active                                                           : 1;
    uint32 eth_oam_p2_p_mode                                                : 1;
    uint32 mep_type                                                         : 3;

    uint32 rmep_mac_sa_38_7                                                : 32;

    uint32 rsv_0                                                            : 11;
    uint32 u1_g1_ccm_seq_num_9_0                                           : 10;
    uint32 is_csf_en                                                        : 1;
    uint32 mac_status_change                                                : 1;
    uint32 rmep_mac_sa_47_39                                               : 9;

    uint32 exp_ccm_num_1_0                                                 : 2;
    uint32 cnt_shift_while                                                  : 3;
    uint32 aps_signal_fail_remote                                           : 5;
    uint32 u1_g1_ccm_seq_num_31_10                                         : 22;

    uint32 aps_group_id_1_0                                                : 2;
    uint32 rmep_last_intf_status                                            : 3;
    uint32 first_pkt_rx                                                     : 1;
    uint32 rmep_last_port_status                                            : 2;
    uint32 seq_num_fail_counter                                             : 6;
    uint32 mac_addr_update_disable                                          : 1;
    uint32 rmep_while                                                       : 4;
    uint32 rmep_last_rdi                                                    : 1;
    uint32 d_unexp_period                                                   : 1;
    uint32 d_unexp_period_timer                                             : 4;
    uint32 d_loc                                                            : 1;
    uint32 exp_ccm_num_7_2                                                 : 6;

    uint32 rsv_2                                                            : 11;
    uint32 fast_aps_en                                                      : 1;
    uint32 rsv_1                                                            : 10;
    uint32 aps_group_id_11_2                                               : 10;
};

struct ds_bfd_mep_d2_s
{
    uint32 u2_g1_bfd_srcport_7_0                                           : 8;
    uint32 ccm_interval                                                     : 3;
    uint32 ma_index                                                         : 13;
    uint32 is_up                                                            : 1;
    uint32 is_remote                                                        : 1;
    uint32 is_bfd                                                           : 1;
    uint32 active                                                           : 1;
    uint32 eth_oam_p2_p_mode                                                : 1;
    uint32 mep_type                                                         : 3;

    uint32 rx_csf_while_6_0                                                : 7;
    uint32 micro_b_f_d                                                      : 1;
    uint32 local_diag                                                       : 5;
    uint32 hello_while                                                      : 10;
    uint32 cci_en                                                           : 1;
    uint32 u2_g1_bfd_srcport_15_8                                          : 8;

    uint32 rsv_0                                                            : 11;
    uint32 desired_min_tx_interval_4_0                                     : 5;
    uint32 actual_min_tx_interval                                           : 10;
    uint32 rx_csf_while_12_7                                               : 6;

    uint32 local_disc_26_0                                                 : 27;
    uint32 desired_min_tx_interval_9_5                                     : 5;

    uint32 dest_map_4_0                                                    : 5;
    uint32 ip_da_l                                                          : 20;
    uint32 local_stat                                                       : 2;
    uint32 local_disc_31_27                                                : 5;

    uint32 rsv_1                                                            : 11;
    uint32 aps_group_id                                                     : 6;
    uint32 cc_tx_mode                                                       : 1;
    uint32 dest_map_18_5                                                   : 14;
};

struct ds_bfd_rmep_d2_s
{
    uint32 u1_g1_ip_sa_22_0                                                : 23;
    uint32 protection_path                                                  : 1;
    uint32 is_up                                                            : 1;
    uint32 is_remote                                                        : 1;
    uint32 is_bfd                                                           : 1;
    uint32 active                                                           : 1;
    uint32 eth_oam_p2_p_mode                                                : 1;
    uint32 mep_type                                                         : 3;

    uint32 actual_rx_interval_8_0                                          : 9;
    uint32 aps_bridge_en                                                    : 1;
    uint32 aps_signal_fail_remote                                           : 2;
    uint32 is_csf_tx_en                                                     : 1;
    uint32 required_min_rx_interval                                         : 10;
    uint32 u1_g1_ip_sa_31_23                                               : 9;

    uint32 rsv_0                                                            : 11;
    uint32 defect_while_7_0                                                : 8;
    uint32 local_defect_mult                                                : 4;
    uint32 fast_aps_en                                                      : 1;
    uint32 fbit                                                             : 1;
    uint32 disc_chk_en                                                      : 1;
    uint32 remote_diag                                                      : 5;
    uint32 actual_rx_interval_9                                            : 1;

    uint32 remote_disc_18_0                                                : 19;
    uint32 first_pkt_rx                                                     : 1;
    uint32 defect_mult                                                      : 4;
    uint32 is_csf_en                                                        : 1;
    uint32 is_cv_en                                                         : 1;
    uint32 defect_while_13_8                                               : 6;

    uint32 ip_da_h_10_0                                                    : 11;
    uint32 slow_tx_timer_cfg                                                : 2;
    uint32 is_multi_hop                                                     : 1;
    uint32 ach_chan_type                                                    : 3;
    uint32 remote_stat                                                      : 2;
    uint32 remote_disc_31_19                                               : 13;

    uint32 rsv_1                                                            : 11;
    uint32 aps_group_id                                                     : 6;
    uint32 cc_tx_mode                                                       : 1;
    uint32 pbit                                                             : 1;
    uint32 ip_bfd_ttl                                                       : 8;
    uint32 time_negotiation                                                 : 1;
    uint32 learn_en                                                         : 1;
    uint32 d_loc                                                            : 1;
    uint32 echo_rx_en                                                       : 1;
    uint32 ip_da_h_11                                                      : 1;
};
typedef struct
{
    uint32 byteCount_3_0:4;
    uint32 packetCount_27_0:28;
    uint32 byteCount_35_4;
}DsStats_d2_s;

struct ms_dlb_efd_mon_d2_s
{
    /*word0[31:0]*/
    uint32  rsv0             : 9;
    uint32  dlbMonValid      : 1;
    uint32  dlbMonPtr        : 11;
    uint32  efdMonValid      : 1;
    uint32  efdMonPtr        : 10;

    /*word1-5[31:0]*/
    uint32  rsv1             : 32;
    uint32  rsv2             : 32;
    uint32  rsv3             : 32;
    uint32  rsv4             : 32;
    uint32  rsv5             : 32;

    /*word6[31:0]*/
    uint32  timestamp_21_0   : 22;
    uint32  monType          : 2;
    uint32  rsv6             : 8;

    /*word7[31:0]*/
    uint32  timestamp_53_22  : 32;
};

struct ms_latency_mon_d2_s
{
    union
    {
        struct
        {
            uint32 residenceTime_11_0   :12;
            uint32 region               :4;
            uint32 localPhyPort         :8;
            uint32 channelId            :7;
            uint32 infoType             :1;

            uint32 residenceTime_43_12  :32;

            uint32 timestamp_11_0       :12;
            uint32 sourcePort           :16;
            uint32 residenceTime_47_44  :4;

            uint32 timestamp_43_12      :32;

            uint32 rsv0                 :11;
            uint32 valid                :1;
            uint32 timestamp_63_44      :20;

        }event;

        struct
        {
            uint32 latencyThrdCnt0_23_0 :24;
            uint32 channelId            :7;
            uint32 infoType             :1;


            uint32 latencyThrdCnt2_7_0  :8;
            uint32 latencyThrdCnt1_23_0 :24;

            uint32 latencyThrdCnt3_15_0 :16;
            uint32 latencyThrdCnt2_23_8 :16;

            uint32 latencyThrdCnt4_23_0 :24;
            uint32 latencyThrdCnt3_23_16:8;

            uint32 latencyThrdCnt6_7_0  :8;
            uint32 latencyThrdCnt5_23_0 :24;

            uint32 latencyThrdCnt7_15_0 :16;
            uint32 latencyThrdCnt6_23_8 :16;

            uint32 rsv1                 :24;
            uint32 latencyThrdCnt7_23_16:8;
        }mon; 
    }u;
};
struct temp_irm_resrc_mon_info_d2_s
{
    /*word0~3*/
    union
    {
        struct
        {
            uint32 rsv1                   : 10;
            uint32 channelId              : 6;
            uint32 pktBufCnt              : 14;
            uint32 monInfoType            : 2;

            uint32 rsv2                   : 32;
        }g1;
        struct
        {
            uint32 scCnt_2_1_0            : 2;
            uint32 scCnt_1                : 14;
            uint32 scCnt_0                : 14;
            uint32 monInfoType            : 2;

            uint32 rsv1                   : 6;
            uint32 scCnt_3                : 14;
            uint32 scCnt_2_13_2           : 12;
        }g2;

        struct
        {
            uint32 c2cCnt_1_0             : 2;
            uint32 criticalCnt            : 14;
            uint32 totalCnt               : 14;
            uint32 monInfoType            : 2;

            uint32 rsv1                   : 20;
            uint32 c2cCnt_13_2            : 12;
        }g3;

        struct
        {
            uint32 rsv1                   : 12;
            uint32 mappedTc               : 3;
            uint32 portTcCntValid         : 1;
            uint32 portTcCnt              : 14;
            uint32 monInfoType            : 2;

            uint32 rsv2                   : 32;
        }g4;
    }u;
};

struct ms_irm_mon_d2_s
{
    uint32 u_30_0                         : 31;
    uint32 infoType                       : 1;

    uint32 u_62_31                        : 32;
};

struct temp_erm_resrc_mon_info_d2_s
{
    /*word0~3*/
    union
    {
        struct
        {
            uint32 mcastBufCnt_1_0        : 2;
            uint32 ucastBufCnt            : 14;
            uint32 pktBufCnt              : 14;
            uint32 monInfoType            : 2;

            uint32 rsv1                   : 14;
            uint32 channelId              : 6;
            uint32 mcastBufCnt_13_2       : 12;
        }g1;
        struct
        {
            uint32 scCnt_2_1_0            : 2;
            uint32 scCnt_1                : 14;
            uint32 scCnt_0                : 14;
            uint32 monInfoType            : 2;

            uint32 rsv1                   : 6;
            uint32 scCnt_3                : 14;
            uint32 scCnt_2_13_2           : 12;
        }g2;

        struct
        {
            uint32 criticalCnt_1_0        : 2;
            uint32 spanCnt                : 14;
            uint32 totalCnt               : 14;
            uint32 monInfoType            : 2;

            uint32 rsv1                   : 20;
            uint32 criticalCnt_13_2       : 12;
        }g3;

        struct
        {
            uint32 rsv1                   : 10;
            uint32 detailedType           : 2;
            uint32 queueOffset            : 3;
            uint32 queueCntValid          : 1;
            uint32 queueCnt               : 14;
            uint32 monInfoType            : 2;

            uint32 rsv2                   : 32;
        }g4;
    }u;
};

struct temp_erm_mb_mon_info_d2_s
{
    uint32 cngLevel                       : 2;
    uint32 sc                             : 2;
    uint32 mcastBufCnt                    : 14;
    uint32 ucastBufCnt                    : 14;

    uint32 rsv                            : 25;
    uint32 microburstValid                : 1;
    uint32 channelId                      : 6;
};

struct ms_erm_mon_d2_s
{
    uint32 u_30_0                 :31;
    uint32 infoType               :1;

    uint32 u_62_31                :32;

    uint32 u_94_63                :32;
};

struct sys_learning_aging_decode_d2_s
{
    uint32 uShare_0_10              : 11;
    uint32 is_learning              : 1;
    uint32 hash_result_index        : 19;
    uint32 is_learning_dma          : 1;

    uint32 uShare_11_42             : 32;

    uint32 macsa_0_22               : 23;
    uint32 uShare_43_51             : 9;

    uint32 vsi_id_0_6               : 7;
    uint32 macsa_23_47              : 25;

    uint32 rsv_0                    : 7;
    uint32 fast_learning_en         : 1;
    uint32 learning_source_port     : 16;
    uint32 is_global_src_port       : 1;
    uint32 vsi_id_7_13              : 7;
};
#endif

typedef struct ms_packet_header_d2_s  ms_packet_header_d2_t;
typedef struct ms_dlb_efd_mon_d2_s  ms_dlb_efd_mon_d2_t;
typedef struct ms_latency_mon_d2_s  ms_latency_mon_d2_t;
typedef struct temp_irm_resrc_mon_info_d2_s  temp_irm_resrc_mon_info_d2_t;
typedef struct ms_irm_mon_d2_s  ms_irm_mon_d2_t;
typedef struct temp_erm_resrc_mon_info_d2_s  temp_erm_resrc_mon_info_d2_t;
typedef struct temp_erm_mb_mon_info_d2_s  temp_erm_mb_mon_info_d2_t;
typedef struct ms_erm_mon_d2_s  ms_erm_mon_d2_t;
typedef struct ds_eth_mep_d2_s ds_eth_mep_d2_t;
typedef struct ds_eth_rmep_d2_s ds_eth_rmep_d2_t;
typedef struct ds_bfd_mep_d2_s ds_bfd_mep_d2_t;
typedef struct ds_bfd_rmep_d2_s ds_bfd_rmep_d2_t;
typedef struct sys_learning_aging_decode_d2_s  sys_learning_aging_decode_d2_t;


#ifdef __cplusplus
}
#endif

#endif

